package com.kite.enums;

public enum TropType {
    INTEGER,
    LONG,
    DOUBLE,
    BOOLEAN,
    STRING,
    NULL;

    public static TropType from(Object v) {
        if (v == null)                 return NULL;
        if (v instanceof Integer)      return INTEGER;
        if (v instanceof Long)         return LONG;
        if (v instanceof Double)       return DOUBLE;
        if (v instanceof Boolean)      return BOOLEAN;
        if (v instanceof String)       return STRING;
        /* 其余默认字符串兜底 */
        return STRING;
    }
}
